//
//  MainVCViewController.m
//  SchoolCircle
//
//  Created by 战立军 on 16/5/27.
//  Copyright © 2016年 战立军. All rights reserved.
//

#import "MainVCViewController.h"
#import "SchoolCircleVC.h"
#import "SessonListVC.h"
#import "ActivityVC.h"
#import "PersonVC.h"

@interface MainVCViewController ()

@end

@implementation MainVCViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //if 使tabBarController中管理的viewControllers都符合 UIRectEdgeNone
    if ([UIDevice currentDevice].systemVersion.floatValue >= 7) {
        self.edgesForExtendedLayout = UIRectEdgeNone;
    }
    
    [self addtabbar];
    
    UIView *bgView = [[UIView alloc] initWithFrame:self.tabBar.bounds];
    bgView.backgroundColor = [UIColor whiteColor];
    [self.tabBar insertSubview:bgView atIndex:0];
    self.tabBar.opaque = YES;
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark 

- (void)addtabbar
{
    UINavigationController *circleVC = [[UINavigationController alloc] initWithRootViewController:[[SchoolCircleVC alloc] init]];
     UINavigationController *messageVC = [[UINavigationController alloc] initWithRootViewController:[[SessonListVC alloc] init]];
     UINavigationController *actityVC = [[UINavigationController alloc] initWithRootViewController:[[ActivityVC alloc] init]];
     UINavigationController *meVC = [[UINavigationController alloc] initWithRootViewController:[[PersonVC alloc] init]];
    
    circleVC.tabBarItem.selectedImage = [UIImage imageNamed:@"circle"];
    circleVC.tabBarItem.image = [UIImage imageNamed:@"circle"];
    circleVC.tabBarItem.title = @"圈子";
    
    messageVC.tabBarItem.image = [UIImage imageNamed:@"message"];
    messageVC.tabBarItem.selectedImage = [UIImage imageNamed:@"meaage"];
    messageVC.tabBarItem.title = @"消息";
    
    actityVC.tabBarItem.selectedImage = [UIImage imageNamed:@"activity"];
    actityVC.tabBarItem.image = [UIImage imageNamed:@"activity"];
    actityVC.tabBarItem.title = @"活动";
    
    meVC.tabBarItem.selectedImage = [UIImage imageNamed:@"me@2x"];
    meVC.tabBarItem.image = [UIImage imageNamed:@"me"];
    meVC.tabBarItem.title = @"我";
    
    self.viewControllers = @[circleVC,messageVC,actityVC,meVC];
}

@end
